package org.example.m6;

import java.util.Date;

public class Resident extends Person {
    private String residencyStatus; // 居住状态，例如："Permanent", "Temporary"

    // 构造方法
    public Resident(String name, String gender, Date birthDate, String nationality, String residencyStatus) {
        super(name, gender, birthDate, nationality);//调用父类构造方法
        this.residencyStatus = residencyStatus; //初始化residencyStatus
    }

    // Getter 和 Setter 方法
    public String getResidencyStatus() {
        return residencyStatus;
    }

    public void setResidencyStatus(String residencyStatus) {
        this.residencyStatus = residencyStatus;
    }

    @Override
    public void showInfo() {
        super.showInfo(); //调用父类被覆盖的方法showInfo()
        System.out.println(residencyStatus);//输出居住状态
    }
}
